<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>ru.skillbox</groupId>
  <artifactId>CollectionsMap</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <checkstyle-maven-plugin.version>3.1.1</checkstyle-maven-plugin.version>
    <junit.platform.version>5.8.0-M1</junit.platform.version>
    <puppycrawl.version>8.34</puppycrawl.version>
    <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
    <checkstyle.config.location>${basedir}/checkstyle.xml</checkstyle.config.location>
    <linkXRef>false</linkXRef>
  </properties>


  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle-maven-plugin.version}</version>
        <configuration>
          <!-- Use last available configuration -->
          <configLocation>checkstyle.xml</configLocation>
          <configLocation>${checkstyle.config.location}</configLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <violationSeverity>warning</violationSeverity>
          <failsOnError>true</failsOnError>
          <logViolationsToConsole>true</logViolationsToConsole>
        </configuration>
        <executions>
          <execution>
            <id>verify-style</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <argLine>--enable-preview</argLine>
        </configuration>
      </plugin>
            <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.9.1</version>
              <configuration>
                <inputEncoding>UTF-8</inputEncoding>
                <outputEncoding>UTF-8</outputEncoding>
                <locales>ru,en</locales>
                <generateReports>true</generateReports>
              </configuration>
      </plugin>

    </plugins>
  </build>

  <!-- `mvn clean test site` to generate the junit html report-->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>3.0.0-M5</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle-maven-plugin.version}</version>
        <configuration>
          <configLocation>${checkstyle.config.location}</configLocation>
          <encoding>UTF-8</encoding>
        </configuration>

      </plugin>
    </plugins>
  </reporting>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.platform.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>${junit.platform.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.platform.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.puppycrawl.tools</groupId>
      <artifactId>checkstyle</artifactId>
      <version>${puppycrawl.version}</version>
    </dependency>
  </dependencies>

</project>
